package com.supermarket.manage.provider.ucenter.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.supermarket.manage.common.dto.ucenter.request.UserPageParams;
import com.supermarket.manage.common.pojo.MyUser;
import com.supermarket.manage.common.pojo.Permission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Faxon
 * @version 1.0
 * @date 2020-02-14 19:50
 **/
@Mapper
public interface UserMapper extends BaseMapper<MyUser> {
    /**
     * 根据userId获取权限列表
     *
     * @param userId
     * @return
     */
    List<Permission> getPermissionListByUserId(Long userId);

    /**
     * 分页查询用户列表
     *
     * @param con
     * @return
     */
    Page<MyUser> getUserPageList(@Param("con") UserPageParams con);

    /**
     * 根据用户id查询用户信息
     *
     * @param userId
     * @return
     */
    MyUser getUserById(Long userId);

    /**
     * 根据用户名查询用户信息
     *
     * @param username
     * @return
     */
    MyUser getUserByUserName(String username);

    /**
     * 获取员工列表
     *
     * @param params
     * @return
     */
    List<MyUser> getUserList(@Param("con") UserPageParams params);
}
